Skip to content

feat: add @pulp-ui/sdk package with orval codegen and pulpFetch mutator - #367

Merged
ggainey merged 8 commits into
pulp:mainfrom
Redtigercod4:feat/sdk-codegen
Oct 16, 2026
Merged

ggainey merged 8 commits into
pulp:mainfrom
Redtigercod4:feat/sdk-codegen

Conversation

@Redtigercod4

@Redtigercod4 Redtigercod4 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds @pulp-ui/sdk, a new npm workspace package that generates a typed Pulp API Client via orval instead of hand-written API modules, for both core and plugin implementations. This was first prototyped on feat/next/sdk-codegen and ported across as a standalone piece of work, laying the foundation for wider typed interfaces - this PR only scoped to core/status as a demonstrator.

So what benefits does having this SDK give to Pulp-UI:

  • Type safety from the OpenAPI spec: each plugin and the core APIs are now matched from the OpenAPI spec instead of relying on hand-written mismatched types.
  • Low-maintenance: new endpoints or changes can be easily reflected with a regenerate, instead of manually trawl through each related codebase.
  • Early drift warning and consistent approach: version matching to Pulp Core and plugins becomes much easier - especially useful once v4 enters the UI.

Note on diff size: introducing workspaces reconfigures the whole package-lock.json to the new tree dependency approach needed for peer/transitive dependencies on packages/sdk; only around ~550 changed lines are the actually generated or typed code.

Changes

  1. Added packages/sdk as a new npm workspace with its own tsconfig.json pinned to Typescript 7, independent of the projects Typescript 5.9 requirement. Create a tsconfig.base.json to allow future linkage between each tsconfig.json.
  2. Added orval.config.ts to configure orval to generate an API Client for status. Links into ensuring versions are matched before and after with generated files matching current project conventions with naming etc.
  3. Ported pulpFetch, a custom mutator used on each request call along with the relevant tests using vitest & msw.
  4. Generated the first API vertical slice with its response types and model (src/core/status).
  5. Added scripts to check pulp-versions match the instance type prior to regenerating clients and keeps pulp-versions.json up to date.
  6. Exported src/core/status for usage within the root application and registered @pulp-ui/sdk as a root dependency on the applicaton.

Out of Scope

  1. Codegen for plugins beyond core.
  2. Auth/session cookie for pulpFetch
  3. CI workflow integrations for @pulp-ui/sdk
  4. Migrating any existing src/api consumers onto the new pattern

Blockers

N/A

Linked Issues

N/A

AI Assistance

Claude (Sonnet 5) was consulted during development for discussions, suggestions and research. All code was written and reviewed by author.

Sources

  1. https://orval.dev/
  2. https://mswjs.io/
  3. https://vitest.dev/
  4. https://github.com/Redtigercod4/pulp-ui/tree/feat/next/sdk-codegen
  5. https://docs.npmjs.com/cli/v8/using-npm/workspaces

@Redtigercod4 Redtigercod4 changed the title feat: add @pulp-ui/sdk package with orval codegen and pulpFetch mutator feat(#367): add @pulp-ui/sdk package with orval codegen and pulpFetch mutator Sep 28, 2026
@Redtigercod4 Redtigercod4 changed the title feat(#367): add @pulp-ui/sdk package with orval codegen and pulpFetch mutator feat: add @pulp-ui/sdk package with orval codegen and pulpFetch mutator Oct 1, 2026
@Redtigercod4
Redtigercod4 marked this pull request as ready for review October 1, 2026 11:06

@ggainey ggainey left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/me cheers wildly

@ggainey
ggainey merged commit fc63d39 into pulp:main Oct 16, 2026
4 of 5 checks passed
@Redtigercod4 Redtigercod4 added this to the Epic: pulpcore milestone Oct 22, 2026
@Redtigercod4 Redtigercod4 added enhancement New feature or request javascript Pull requests that update Javascript code next Features aligned to the next-gen PulpUI labels Oct 22, 2026
@Redtigercod4 Redtigercod4 self-assigned this Oct 22, 2026
@Redtigercod4
Redtigercod4 deleted the feat/sdk-codegen branch November 1, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request javascript Pull requests that update Javascript code next Features aligned to the next-gen PulpUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants